import 'dart:collection';

import 'package:aweb5/dioutil/DioRequestBuilder.dart';
import 'package:aweb5/dioutil/RequestCall.dart';
//import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';

class GetBuilder extends DioRequestBuilder {


  String appendPara(String url,Map<String,String> para){

    if(para.length==0){
      return url;
    }
    url = url +"?";
    para.forEach((key, value) {

      url = url + key+"="+value+"&";

    });
    return url.substring(0,url.length-1);

  }

  GetBuilder url(String url) {
    this.zUrl = url;
    return this;
  }

  @override
  GetBuilder params(Map<String, String> params) {
    this.zParams = params;
    return this;
  }

  @override
  GetBuilder addParam(String key, String value) {
    if (zParams == null) {
      zParams = new Map();
    }
    zParams[key] = value;
    return this;
  }

  @override
  GetBuilder header(Map<String, String> header) {
    this.zHeader = header;
    return this;
  }

  @override
  GetBuilder addHeader(String key, String value) {
    if (this.zHeader == null) {
      zHeader = new Map();
    }
    zHeader[key] = value;
    return this;
  }

  @override
  GetBuilder tag(Object object) {
    this.zTag = object;
    return this;
  }

  @override
  RequestCall build() {
    // TODO: implement build
    throw UnimplementedError();
  }
}
